import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_my_web/pages/tools/drop_draw_board/draw_board_widget.dart';
import 'package:flutter_my_web/pages/tools/drop_draw_board/drop_widget_list_widget.dart';
import 'package:flutter_my_web/pages/tools/drop_draw_board/drop_widget_property_panel_widget.dart';
import 'package:flutter_my_web/pages/tools/drop_draw_board/event/bulid_draw_board_json_event.dart';
import 'package:flutter_my_web/widget/AppBarTitleWidget.dart';
import 'package:flutter_my_web/widget/BlueMaterialButton.dart';
import 'package:flutter_my_web/utils/dis_loading.dart' if (dart.library.js) 'package:flutter_my_web/utils/web_dis_loading.dart' as disloading;



class DropDrawBoardPage extends StatefulWidget {
  const DropDrawBoardPage({Key? key}) : super(key: key);

  @override
  State<DropDrawBoardPage> createState() => _dropDrawBoardPageState();
}

class _dropDrawBoardPageState extends State<DropDrawBoardPage> {
  @override
  void initState() {
    super.initState();
    disloading.Disloading().disLoading();
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: AppBarTitleWidget("拖拽画板"),
      ),
      body: Row(children: [
        Expanded(
          flex: 4,
          child: DropWidgetListWidget(),
        ),
        Container(margin:EdgeInsets.symmetric(horizontal: 10),width: 1,color: Colors.red,),
        Expanded(
          flex: 10,
          child: Column(
            children: [
              BlueMaterialButton("生成json", (){
                buildDrawBoardJsonEvent();
              }),
              Expanded(child: DrawBoardWidget()),
            ],
          ),),
        Container(margin:EdgeInsets.symmetric(horizontal: 10),width: 1,color: Colors.red,),
        Expanded(flex:4,child:DropWidgetPropertyPanelWidget())
      ],),
    );
  }
}


